Digital computers execute a variety of diverse types of computer programs, with each program including a series of instructions that enable the computer to perform specific operations in connection with data. One problem that often arises in connection with execution of computer programs is determining, with some reasonable degree of accuracy, the amount of time that a particular computer will take to execute at least a portion of a computer program, that is, a "computer program fragment." This problem can arise in several contexts. For example, the problem can arise in the context of program development, particularly during a phase of program development in which a program developer is attempting to streamline a program or program fragment which is under development, to optimize the speed with which it will be executed by one or several types of computer platforms.
The problem can also arise in the context of benchmarking, which may be used to determine the speed of a particular type of computer system in executing a particular type of program, or, more often, to determine the relative speeds as among a number of types of computer systems in executing a particular type of program. Benchmarking is often used by, for example, by a potential customer who wishes to purchase a computer for one or several applications. In such a case, the potential customer will typically have one or more programs executed on the various types of computers under consideration for purchase. In such a case, the programs used in benchmarking may be representative of the applications that the potential customer expects to execute with the computer to be purchased, and he or she will typically select one of the types for purchase based on the execution times for the respective programs on the various types of computers. This problem of timing execution of computer programs and program fragments may also arise in other contexts. Generally, the execution time for a program or a program fragment (generally, a "program fragment") on a particular computer is determined by determining a beginning or "start" time value, executing the program one or more times or "iterations," determining an end or "stop" time value, and taking the difference between the end time value and the beginning time value. The difference between the end time value and the beginning time value indicates the amount of time, or the "time interval," during which the computer executed the program for the particular number of iterations. The time interval for executing the program fragment one time would be the time interval divided by the number of iterations the program fragment was executed. One problem that arises in connection with determining execution time is to, in turn, determine an optimal number of iterations that a program fragment should be executed to get a predetermined degree of timing accuracy, while avoiding executing the program or fragment an excessive number of iterations.